#!/usr/bin/python
# encoding: utf-8
'''
@File    :   code.py
@Time    :   2020/03/11 21:54:19
@Author  :   fangkaijin 
@Version :   1.0
@Contact :   fangkaijin@gmail.com
@License :   杭州移动互联
@Desc    :   None
'''

# 导入库包

import sys, os

from tkinter import *

import tkinter
import tkinter.messagebox as messagebox
from PIL import Image, ImageTk

root = tkinter.Tk()
# 设置窗口标题:
root.title('美术宝')
root.geometry('800x500+200+50')

canvas = tkinter.Canvas(root, height=200, width=200)
png = Image.open('icon_app_logo.png')  # 打开图片
image_file = ImageTk.PhotoImage(png)
canvas.create_image(100, 100, image=image_file)
canvas.pack(side = 'top')

#Frame
rootFrame = tkinter.Frame(root, height = 10)
rootFrame.pack()
left = tkinter.Frame(rootFrame)
label1 = tkinter.Label(left, text = '用户名', width = 10, height = 2, font = ("黑体",16)).pack(side = 'top')
label2 = tkinter.Label(left, text = '密码', width = 10, height = 2, font = ("黑体",16)).pack(side = 'top')
left.pack(side = 'left')

nameShow = tkinter.StringVar()
right = tkinter.Frame(rootFrame)
userName = tkinter.Entry(right, textvariable = nameShow,
                         width = 30, font = ("黑体",16), borderwidth=1,
                         validate="focus")
userName.pack(side = 'top')
pswShow = tkinter.StringVar()
psw = tkinter.Entry(right, textvariable = pswShow,
                    width = 30, font = ("黑体",16), borderwidth=1,
                    show = '*')
psw.pack(side = 'top')
right.pack(side = 'right')
def do_login():
    pass
login = tkinter.Button(root, text = '登录', command = do_login, width = 20, height = 4, font = ("黑体",16))
login.pack(side = 'top')

# 主消息循环:
root.mainloop()
